// 引入axios
import axios from './axios'

// 创建订单
export const saveOrder = data => {
  return axios({
    method: 'post',
    url: '/front/order/saveOrder',
    data
  })
}

// 获取支付方式
export const getPayInfo = shopOrderNo => {
  return axios({
    method: 'get',
    url: `/front/pay/getPayInfo?shopOrderNo=${shopOrderNo}`
  })
}

// 发起支付
export const saveOrderBuy = data => {
  return axios({
    method: 'post',
    url: '/front/pay/saveOrder',
    data
  })
}

// 获取支付结果
export const getPayResult = params => {
  return axios({
    method: 'get',
    url: '/front/pay/getPayResult',
    headers: { 'content-type': 'application/json' },
    params
  })
}
